From 9e718150463e5810a9e1410a6c1f97efdb8ce594 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 14 May 2007 18:33:53 +0000 Subject: [PATCH] Functions: gtk_about_dialog_get/set_name() were deprecated in favour of * gtk/gtkaboutdialog.c: Functions: gtk_about_dialog_get/set_name() were deprecated in favour of gtk_about_dialog_get/set_program_name(), the GtkAboutDialog now uses the "program-name" property instead of the conflicting "name" property (fixes bug 345822). svn path=/trunk/; revision=17845 --- ChangeLog | 7 +++++++ README.in | 7 +++++++ gtk/gtkaboutdialog.c | 47 ++++++++++++++++++++++++++++++++++++++++---- gtk/gtkaboutdialog.h | 5 +++++ 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06c4eddf4b..c462e023ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-14 Tristan Van Berkom + + * gtk/gtkaboutdialog.c: Functions: gtk_about_dialog_get/set_name() + were deprecated in favour of gtk_about_dialog_get/set_program_name(), + the GtkAboutDialog now uses the "program-name" property instead of + the conflicting "name" property (fixes bug 345822). + 2007-05-14 Emmanuele Bassi * configure.in: Add check for GNU extensions to ftw()/nftw(). diff --git a/README.in b/README.in index 18b581567e..cf6b373bcf 100644 --- a/README.in +++ b/README.in @@ -27,6 +27,13 @@ Installation See the file 'INSTALL' +Release notes for 2.12 +====================== + +* Functions: gtk_about_dialog_get/set_name() were deprecated in favour of + gtk_about_dialog_get/set_program_name(), the GtkAboutDialog now uses the + "program-name" property instead of the conflicting "name" property. + Release notes for 2.10 ====================== diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 6d64f6de0e..cd63f5b74a 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -193,7 +193,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass) */ g_object_class_install_property (object_class, PROP_NAME, - g_param_spec_string ("name", + g_param_spec_string ("program-name", P_("Program name"), P_("The name of the program. If this is not set, it defaults to g_get_application_name()"), NULL, @@ -528,7 +528,7 @@ gtk_about_dialog_init (GtkAboutDialog *about) gtk_widget_grab_focus (close_button); /* force defaults */ - gtk_about_dialog_set_name (about, NULL); + gtk_about_dialog_set_program_name (about, NULL); gtk_about_dialog_set_logo (about, NULL); } @@ -572,7 +572,7 @@ gtk_about_dialog_set_property (GObject *object, switch (prop_id) { case PROP_NAME: - gtk_about_dialog_set_name (about, g_value_get_string (value)); + gtk_about_dialog_set_program_name (about, g_value_get_string (value)); break; case PROP_VERSION: gtk_about_dialog_set_version (about, g_value_get_string (value)); @@ -699,9 +699,28 @@ gtk_about_dialog_get_property (GObject *object, * dialog and must not be modified. * * Since: 2.6 + * + * @Deprecated: 2.12: Use gtk_about_dialog_get_program_name() instead. **/ G_CONST_RETURN gchar * gtk_about_dialog_get_name (GtkAboutDialog *about) +{ + return gtk_about_dialog_get_program_name (about); +} + +/** + * gtk_about_dialog_get_program_name: + * @about: a #GtkAboutDialog + * + * Returns the program name displayed in the about dialog. + * + * Return value: The program name. The string is owned by the about + * dialog and must not be modified. + * + * Since: 2.12 + **/ +G_CONST_RETURN gchar * +gtk_about_dialog_get_program_name (GtkAboutDialog *about) { GtkAboutDialogPrivate *priv; @@ -745,10 +764,29 @@ update_name_version (GtkAboutDialog *about) * If this is not set, it defaults to g_get_application_name(). * * Since: 2.6 + * + * @Deprecated: 2.12: Use gtk_about_dialog_set_program_name() instead. **/ void gtk_about_dialog_set_name (GtkAboutDialog *about, const gchar *name) +{ + gtk_about_dialog_set_program_name (about, name); +} + +/** + * gtk_about_dialog_set_program_name: + * @about: a #GtkAboutDialog + * @name: the program name + * + * Sets the name to display in the about dialog. + * If this is not set, it defaults to g_get_application_name(). + * + * Since: 2.12 + **/ +void +gtk_about_dialog_set_program_name (GtkAboutDialog *about, + const gchar *name) { GtkAboutDialogPrivate *priv; gchar *tmp; @@ -762,9 +800,10 @@ gtk_about_dialog_set_name (GtkAboutDialog *about, update_name_version (about); - g_object_notify (G_OBJECT (about), "name"); + g_object_notify (G_OBJECT (about), "program-name"); } + /** * gtk_about_dialog_get_version: * @about: a #GtkAboutDialog diff --git a/gtk/gtkaboutdialog.h b/gtk/gtkaboutdialog.h index f9337e6095..29555b8d34 100644 --- a/gtk/gtkaboutdialog.h +++ b/gtk/gtkaboutdialog.h @@ -64,9 +64,14 @@ void gtk_show_about_dialog (GtkWindow const gchar *first_property_name, ...) G_GNUC_NULL_TERMINATED; +#ifndef GTK_DISABLE_DEPRECATED G_CONST_RETURN gchar *gtk_about_dialog_get_name (GtkAboutDialog *about); void gtk_about_dialog_set_name (GtkAboutDialog *about, const gchar *name); +#endif /* GTK_DISABLE_DEPRECATED */ +G_CONST_RETURN gchar *gtk_about_dialog_get_program_name (GtkAboutDialog *about); +void gtk_about_dialog_set_program_name (GtkAboutDialog *about, + const gchar *name); G_CONST_RETURN gchar *gtk_about_dialog_get_version (GtkAboutDialog *about); void gtk_about_dialog_set_version (GtkAboutDialog *about, const gchar *version); -- 2.30.2